#ifndef __PTRLIST_H
#define __PTRLIST_H
#include <stdio.h>
using namespace std;
template <typename PtrType> class PtrList {
	public:
	PtrList() {
		this->value = NULL;
		this->next = NULL;
	}
	void push() {
		PtrList<PtrType> *next = this->next;
		this->next = new PtrList<PtrType>;
		this->next->next = next;
		this->next->swap(this);
		return;
	}
	void swap(PtrList<PtrType> *node) {
		PtrType value = node->value;
		node->value = this->value;
		this->value = value;
		return;
	}
	PtrType value;
	PtrList *next;
};
#endif
